var lastTouchEnd = 0
document.documentElement.addEventListener(
	'touchend',
	function(event) {
		var now = Date.now()
		if (now - lastTouchEnd <= 300) {
			event.preventDefault()
		}
		lastTouchEnd = now
	},
	{
		passive: false
	}
)

$(function (){

	$(".listBox").find('li').eq(sessionStorage.getItem('cacheIndex')).addClass('selected');

	$(".listBox").find('li').click(function (){

		$("#scoingc2").val('');
		$("#scoingc2s").val('');
		$("#scoingc3s").val('');
		$("#scoingc3").val('');
		$("#scoingc1").val('');
		$("#scoingc1s").val('');

		$("#scoingb1").val('');
		$("#scoingb1s").val('');
		$("#scoingb2").val('');
		$("#scoingb2s").val('');
		$("#scoingb3").val('');
		$("#scoingb3s").val('');

		$("#scoingb4").val('');
		$("#scoingb4s").val('');

		$("#scoingb5").val('');
		$("#scoingb5s").val('');

		$("#scoingc4").val('');
		$("#scoingc4s").val('');

		$("#scoingc5").val('');
		$("#scoingc5s").val('');

		$(this).attr('data-index',$(this).index());

		$(".selected").removeClass('selected');
		$(this).addClass('selected');
		$(".titleA").html( $(this).find('.court').val()+'-赛场' );
		$(".rubr").html( $(this).find('.answerList').val() );

		let score1 = $(".selected").find('.score1').val();
		let score2 = $(".selected").find('.score2').val();
		let score3 = $(".selected").find('.score3').val();
		let score4 = $(".selected").find('.score4').val();
		let score5 = $(".selected").find('.score5').val();
		let score1s = $(".selected").find('.score6').val();
		let score2s = $(".selected").find('.score7').val();
		let score3s = $(".selected").find('.score8').val();
		let score4s = $(".selected").find('.score9').val();
		let score5s = $(".selected").find('.score10').val();

		let scorec1 = $(".selected").find('.score11').val();
		let scorec2 = $(".selected").find('.score12').val();
		let scorec3 = $(".selected").find('.score13').val();
		let scorec4 = $(".selected").find('.score14').val();
		let scorec5 = $(".selected").find('.score15').val();
		let scorec1s = $(".selected").find('.score16').val();
		let scorec2s = $(".selected").find('.score17').val();
		let scorec3s = $(".selected").find('.score18').val();
		let scorec4s = $(".selected").find('.score19').val();
		let scorec5s = $(".selected").find('.score20').val();

		// 视频
		let smap1 = $(".selected").find('.smap1').val();
		let smap2 = $(".selected").find('.smap2').val();
		let smap3 = $(".selected").find('.smap3').val();
		let smap4 = $(".selected").find('.smap4').val();
		let smap5 = $(".selected").find('.smap5').val();
		let smap6 = $(".selected").find('.smap6').val();
		let smap7 = $(".selected").find('.smap7').val();
		let smap8 = $(".selected").find('.smap8').val();
		let smap9 = $(".selected").find('.smap9').val();
		let smap10 = $(".selected").find('.smap10').val();

		// 图片
		let simg1 = $(".selected").find('.simg1').val();
		let simg2 = $(".selected").find('.simg2').val();
		let simg3 = $(".selected").find('.simg3').val();
		let simg4 = $(".selected").find('.simg4').val();
		let simg5 = $(".selected").find('.simg5').val();
		let simg6 = $(".selected").find('.simg6').val();
		let simg7 = $(".selected").find('.simg7').val();
		let simg8 = $(".selected").find('.simg8').val();
		let simg9 = $(".selected").find('.simg9').val();
		let simg10 = $(".selected").find('.simg10').val();

		if(smap1) smap1 = JSON.parse(smap1);
		if(smap2) smap2 = JSON.parse(smap2);
		if(smap3) smap3 = JSON.parse(smap3);
		if(smap4) smap4 = JSON.parse(smap4);
		if(smap5) smap5 = JSON.parse(smap5);
		if(smap6) smap6 = JSON.parse(smap6);
		if(smap7) smap7 = JSON.parse(smap7);
		if(smap8) smap8 = JSON.parse(smap8);
		if(smap9) smap9 = JSON.parse(smap9);
		if(smap10) smap10 = JSON.parse(smap10);

		if(simg1) simg1 = JSON.parse(simg1);
		if(simg2) simg2 = JSON.parse(simg2);
		if(simg3) simg3 = JSON.parse(simg3);
		if(simg4) simg4 = JSON.parse(simg4);
		if(simg5) simg5 = JSON.parse(simg5);
		if(simg6) simg6 = JSON.parse(simg6);
		if(simg7) simg7 = JSON.parse(simg7);
		if(simg8) simg8 = JSON.parse(simg8);
		if(simg9) simg9 = JSON.parse(simg9);
		if(simg10) simg10 = JSON.parse(simg10);

		$(".picture").hide();
		$(".video").hide();

		if(score1){
			$(".reveal1").show();
			$("#score1").text(score1)
			$("#scoingb1").hide().val(score1);
			$("#fractionA").hide();
			if(simg1.print) $("#b1").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg1.print}"></div>`).show();
			$("#b1").find('.scoingb1img1').val(simg1.print)

			if(simg1.svip) $("#b1").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg1.svip}" type="video/mp4"></video></div>`).show();
			$("#b1").find('.scoingb1smp1').val(simg1.svip)

		}else{
			$(".reveal1").hide();
			$("#scoingb1").show();
			$("#fractionA").show();
		}

		if(score1s){
			$(".reveal1s").show();
			$("#score1s").text(score1s);
			$("#scoingb1s").hide().val(score1s);
			$("#fractionAs").hide();
			if(smap1.print) $("#b2").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap1.print}"></div>`).show();
			$("#b2").find('.scoingb1img1').val(smap1.print)

			if(smap1.svip) $("#b2").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap1.svip}" type="video/mp4"></video></div>`).show();
			$("#b2").find('.scoingb1smp1').val(smap1.svip)

		}else{
			$(".reveal1s").hide();
			$("#scoingb1s").show();
			$("#fractionAs").show();
		}

		if(score2){
			$("#scoingb2").hide().val(score2);
			$(".reveal2").show();
			$("#score2").text(score2)
			$("#fractionB").hide();
			if(simg2.print) $("#b3").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg2.print}"></div>`).show();
			$("#b3").find('.scoingb1img1').val(simg2.print)

			if(simg2.svip) $("#b3").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg2.svip}" type="video/mp4"></video></div>`).show();
			$("#b3").find('.scoingb1smp1').val(simg2.svip)

		}else{
			$(".reveal2").hide();
			$("#scoingb2").show();
			$("#fractionB").show();
		}

		if(score2s){
			$("#scoingb2s").hide().val(score2s);
			$(".reveal2s").show();
			$("#score2s").text(score2s)
			$("#fractionBs").hide();
			if(smap2.print) $("#b4").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap2.print}"></div>`).show();
			$("#b4").find('.scoingb1img1').val(smap2.print)

			if(smap2.svip) $("#b4").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap2.svip}" type="video/mp4"></video></div>`).show();
			$("#b4").find('.scoingb1smp1').val(smap2.svip)

		}else{
			$(".reveal2s").hide();
			$("#scoingb2s").show();
			$("#fractionBs").show();
		}

		if(score3){
			$("#scoingb3").hide().val(score3);
			$(".reveal3").show();
			$("#score3").text(score3)
			$("#fractionC").hide();
			if(simg3.print) $("#b5").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg3.print}"></div>`).show();
			$("#b5").find('.scoingb1img1').val(simg3.print)

			if(simg3.svip) $("#b5").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg3.svip}" type="video/mp4"></video></div>`).show();
			$("#b5").find('.scoingb1smp1').val(simg3.svip)

		}else{
			$(".reveal3").hide();
			$("#scoingb3").show();
			$("#fractionC").show();
		}

		if(score3s){
			$("#scoingb3s").hide().val(score3s);
			$(".reveal3s").show();
			$("#score3s").text(score3s)
			$("#fractionCs").hide();
			$("#score1s").text(score1s);
			if(smap3.print) $("#b6").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap3.print}"></div>`).show();
			$("#b6").find('.scoingb1img1').val(smap3.print)

			if(smap3.svip) $("#b6").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap3.svip}" type="video/mp4"></video></div>`).show();
			$("#b6").find('.scoingb1smp1').val(smap3.svip)

		}else{
			$(".reveal3s").hide();
			$("#scoingb3s").show();
			$("#fractionCs").show();
		}

		if(score4){
			$("#scoingb4").hide().val(score4);
			$(".revealb4").show();
			$("#score4").text(score4)
			$("#fractionts").hide();
			if(simg4.print) $("#b7").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg4.print}"></div>`).show();
			$("#b7").find('.scoingb1img1').val(simg4.print)
			if(simg4.svip) $("#b7").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg4.svip}" type="video/mp4"></video></div>`).show();
			$("#b7").find('.scoingb1smp1').val(simg4.svip)

		}else{
			$(".revealb4").hide();
			$("#scoingb4").show();
			$("#fractionts").show();
		}

		if(score4s){
			$("#scoingb4s").hide().val(score4s);
			$(".revealb4s").show();
			$("#score4s").text(score4s)
			$("#fractionts").hide();
			if(smap4.print) $("#b8").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap4.print}"></div>`).show();
			$("#b8").find('.scoingb1img1').val(smap4.print)
			if(smap4.svip) $("#b8").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap4.svip}" type="video/mp4"></video></div>`).show();
			$("#b8").find('.scoingb1smp1').val(smap4.svip)
		}else{
			$(".revealb4s").hide();
			$("#scoingb4s").show();
			$("#fractionts").show();
		}

		if(score5){
			$("#scoingb5").hide().val(score5);
			$(".revealb5").show();
			$("#score5").text(score5)
			$("#fractionys").hide();
			if(simg5.print) $("#b9").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg5.print}"></div>`).show();
			$("#b9").find('.scoingb1img1').val(simg5.print)

			if(simg5.svip) $("#b9").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg5.svip}" type="video/mp4"></video></div>`).show();
			$("#b9").find('.scoingb1smp1').val(simg5.svip)
		}else{
			$(".revealb5").hide();
			$("#scoingb5").show();
			$("#fractionys").show();
		}

		if(score5s){
			$("#scoingb5s").hide().val(score5s);
			$(".revealb5s").show();
			$("#score5s").text(score5s)
			$("#fractionys").hide();
			if(smap5.print) $("#b10").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap5.print}"></div>`).show();
			$("#b10").find('.scoingb1img1').val(smap5.print)

			if(smap5.svip) $("#b10").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap5.svip}" type="video/mp4"></video></div>`).show();
			$("#b10").find('.scoingb1smp1').val(smap5.svip)
		}else{
			$(".revealb5s").hide();
			$("#scoingb5s").show();
			$("#fractionys").show();
		}

		if(scorec1){
			$("#scoingc1").hide().val(scorec1);
			$(".reveal4").show();
			$("#scoin1").text(scorec1)
			$("#fractionDs").hide();
			if(simg6.print) $("#b11").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg6.print}"></div>`).show();
			$("#b11").find('.scoingb1img1').val(simg6.print)

			if(simg6.svip) $("#b11").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg6.svip}" type="video/mp4"></video></div>`).show();
			$("#b11").find('.scoingb1smp1').val(simg6.svip)

		}else{
			$(".reveal4").hide();
			$("#scoingc1").show();
			$("#fractionDs").show();
		}

		if(scorec1s){
			$("#scoingc1s").hide().val(scorec1s);
			$(".reveal4s").show();
			$("#scoin1s").text(scorec1s)
			$("#fractionDs").hide();
			if(smap6.print) $("#b12").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap6.print}"></div>`).show();
			$("#b12").find('.scoingb1img1').val(smap6.print)
			if(smap6.svip) $("#b12").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap6.svip}" type="video/mp4"></video></div>`).show();
			$("#b12").find('.scoingb1smp1').val(smap6.svip)

		}else{
			$(".reveal4s").hide();
			$("#scoingc1s").show();
			$("#fractionDs").show();
		}

		if(scorec2){
			$("#scoingc2").hide().val(scorec2);
			$(".reveal5").show();
			$("#scoin2").text(scorec2)
			$("#fractionEs").hide();
			if(simg7.print) $("#b13").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg7.print}"></div>`).show();
			$("#b13").find('.scoingb1img1').val(simg7.print)

			if(simg7.svip) $("#b13").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg7.svip}" type="video/mp4"></video></div>`).show();
			$("#b13").find('.scoingb1smp1').val(simg7.svip)

		}else{
			$(".reveal5").hide();
			$("#scoingc2").show();
			$("#fractionEs").show();
		}

		if(scorec2s){
			$("#scoingc2s").hide().val(scorec2s);
			$(".reveal5s").show();
			$("#scoin2s").text(scorec2s)
			$("#fractionEs").hide();
			if(smap7.print) $("#b14").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap7.print}"></div>`).show();
			$("#b14").find('.scoingb1img1').val(smap7.print)

			if(smap7.svip) $("#b14").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap7.svip}" type="video/mp4"></video></div>`).show();
			$("#b14").find('.scoingb1smp1').val(smap7.svip)

		}else{
			$(".reveal5s").hide();
			$("#scoingc2s").show();
			$("#fractionEs").show();
		}

		if(scorec3){
			$("#scoingc3").hide().val(scorec3);
			$(".reveal6").show();
			$("#scoin3").text(scorec3)
			$("#fractionGs").hide();
			if(simg8.print) $("#b15").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg8.print}"></div>`).show();
			$("#b15").find('.scoingb1img1').val(simg8.print)

			if(simg8.svip) $("#b15").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg8.svip}" type="video/mp4"></video></div>`).show();
			$("#b15").find('.scoingb1smp1').val(simg8.svip)
		}else{
			$(".reveal6").hide();
			$("#scoingc3").show();
			$("#fractionGs").show();
		}

		if(scorec3s){
			$("#scoingc3s").hide().val(scorec3s);
			$(".reveal6s").show();
			$("#scoin3s").text(scorec3s)
			$("#fractionGs").hide();
			if(smap8.print) $("#b16").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap8.print}"></div>`).show();
			$("#b16").find('.scoingb1img1').val(smap8.print)

			if(smap8.svip) $("#b16").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap8.svip}" type="video/mp4"></video></div>`).show();
			$("#b16").find('.scoingb1smp1').val(smap8.svip)

		}else{
			$(".reveal6s").hide();
			$("#scoingc3s").show();
			$("#fractionGs").show();
		}

		if(scorec4){
			console.log(111,simg9);
			$("#scoingc4").hide().val(scorec4);
			$(".revealc6").show();
			$("#scoin4").text(scorec4)
			$("#fractionjs").hide();
			if(simg9.print) $("#b17").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg9.print}"></div>`).show();
			$("#b17").find('.scoingb1img1').val(simg9.print)

			if(simg9.svip) $("#b17").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg9.svip}" type="video/mp4"></video></div>`).show();
			$("#b17").find('.scoingb1smp1').val(simg9.svip)
		}else{
			$(".revealc6").hide();
			$("#scoingc4").show();
			$("#fractionjs").show();
		}

		if(scorec4s){
			console.log(222,smap9)
			$("#scoingc4s").hide().val(scorec4s);
			$(".revealc6s").show();
			$("#scoin6").text(scorec4s)
			$("#fractionjs").hide();
			if(smap9.print) $("#b18").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap9.print}"></div>`).show();
			$("#b18").find('.scoingb1img1').val(smap9.print)
			if(smap9.svip) $("#b18").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap9.svip}" type="video/mp4"></video></div>`).show();
			$("#b18").find('.scoingb1smp1').val(smap9.svip)

		}else{
			$(".revealc6s").hide();
			$("#scoingc4s").show();
			$("#fractionjs").show();
		}

		if(scorec5){
			$("#scoingc5").hide().val(scorec5);
			$(".revealc7").show();
			$("#scoin5").text(scorec5)
			$("#fractionks").hide();

			if(simg10.print) $("#b19").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${simg10.print}"></div>`).show();
			$("#b19").find('.scoingb1img1').val(simg10.print)
			if(simg10.svip) $("#b19").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${simg10.svip}" type="video/mp4"></video></div>`).show();
			$("#b19").find('.scoingb1smp1').val(simg10.svip)
		}else{
			$(".revealc7").hide();
			$("#scoingc5").show();
			$("#fractionks").show();
		}

		if(scorec5s){
			$("#scoingc5s").hide().val(scorec5s);
			$(".reveal7s").show();
			$("#scoin5s").text(scorec5s)
			$("#fractionks").hide();
			if(smap10.print) $("#b20").find('.picture').html(`<div class="closeBtn"><img class="upImg" src="${smap10.print}"></div>`).show();
			$("#b20").find('.scoingb1img1').val(smap10.print)
			if(smap10.svip) $("#b20").find('.video').html(`<div class="closeBtn"><video controls autoplay name="media"><source src="${smap10.svip}" type="video/mp4"></video></div>`).show();
			$("#b20").find('.scoingb1smp1').val(smap10.svip)
		}else{
			$(".reveal7s").hide();
			$("#scoingc5s").show();
			$("#fractionks").show();
		}
	})
	$(".listBox").find('.selected').click();
})

$(".loginData").click(function (){
	$(".shade").show();
	$(".fixedner").show();
	$(".fixedner").attr({'data-drag':$(this).attr('data-drag'),'data-leve':$(this).attr('data-leve'),'data-reve':$(this).attr('data-reve')})
})

$("#close").click(function (){
	$(".shade").hide();
	$(".fixedner").hide();
})

$("#loginInfo").click(function (){
	let obj = {
		userName: $("#username").val() ,
		passWord: $("#password").val()
	}
	$.ajax({
		cache : true,
		type : "post",
		url : '/jzweb/examinationAnswerSheetCom/oneLevelLogin',
		data : obj,// 你的formid
		async : false,
		error : function(request) {
			parent.layer.alert("Connection error");
		},
		success : function(data) {
			if (data.code == 0) {
				$(".shade").hide();
				$(".fixedner").hide();
				$("#"+$(".fixedner").attr('data-drag')).show();
				$("#"+$(".fixedner").attr('data-leve')).show();
				$("."+$(".fixedner").attr('data-reve')).hide();
				parent.layer.msg("登录成功");
			} else {
				parent.layer.alert(data.msg)
			}
		}
	});
})

function update(url,ev,parame,a,b,scoingb1img,scoingb1smp) {
	let sm1,sm2;
	if( !$("#"+ev).val() || !$("#"+parame).val()){
		layer.msg('请填写打分项!!!');
		return false;
	}

	sm1 = {
		print:$("#"+a).find('.scoingb1img1').val(),
		svip:$("#"+a).find('.scoingb1smp1').val()
	};
	sm2 = {
		print:$("#"+b).find('.scoingb1img1').val(),
		svip:$("#"+b).find('.scoingb1smp1').val()
	}

	let obj = {
		id:	$(".selected").find('.id').val(),
		ids:$(".selected").find('.ids').val(),
		[parame] : $("#"+parame).val(),
		[ev] : $("#"+ev).val(),
		[scoingb1img]: JSON.stringify(sm1),
		[scoingb1smp]: JSON.stringify(sm2)
	}

	$.ajax({
		cache : true,
		type : "get",
		url : url,
		data : obj,// 你的formid
		async : false,
		error : function(request) {
			parent.layer.alert("Connection error");
		},
		success : function(data) {
			if (data.code == 0) {

				// window.location.href = $(".active").context.URL.replace(/#/g,'');
				location.reload();
				parent.layer.msg("操作成功");
				sessionStorage.setItem('cacheIndex',$(".listBox").find('.selected').attr('data-index'))
			} else {
				parent.layer.alert(data.msg)
			}

		}
	});

}


//刷新iframe
function refreshTab() {
	var $pageTabsContent = $('.page-tabs-content');
	$pageTabsContent.children("[data-id]").each(function () {
		if($(this).hasClass('active')==true){
			var target = $('.J_iframe[data-id="' + $(this).data('id') + '"]');
			// console.log("target",target);
			var url = target.attr('src');
			//显示loading提示
			var loading = layer.load();
			target.attr('src', url).load(function () {
				//关闭loading提示
				layer.close(loading);
			});
		}
	});
	// $pageTabsContent.css("margin-left", "0");

}

layui.use(['upload', 'element', 'layer'], function() {
	var upload = layui.upload;
	upload.render({
		elem: '.demoMore'
		,accept: 'file'
		,file:''
		, done: function ( res ) {

			if( this.type == '1' ){
				str = `
				<div class="closeBtn">
					<img class="upImg" src="${res.data}">
<!--						<span class="iconclose" data-type="${this.type}"><img src="../../../img/close.png"></span>-->
				</div>`;
				$("#"+this.id).find(".scoingb1img1").val(res.data);
				$("#"+this.id).find(".picture").html(str).show();
			}

			if( this.type == '2' ){
				str = `
					<div class="closeBtn">
						<video controls autoplay name="media">
                            <source src="${res.data}" type="video/mp4">
                        </video>
<!--						<span class="iconclose" data-type="${this.type}"><img src="../../../img/close.png"></span>-->
					</div>`;
				$("#"+this.id).find(".scoingb1smp1").val(res.data);
				$("#"+this.id).find(".video").html(str).show();
			}

			// $(".iconclose").click(function (){
			// 	$(this).parents('.closeBtn').remove();
			// 	if( $(this).attr('data-type') == '1'){
			// 		$("#scoingb1img").val('')
			// 	}
			// 	if($(this).attr('data-type') == '2'){
			// 		$("#scoingb1smp4").val('')
			// 	}
			// })
		}
	})
})

$("body").on("click",".upImg",function (){
	$(".shade").show();
	$(".blow").show();
	$(".blow").find('img').attr('src',$(this).attr("src"));
})

$(".shade").click(function (){
	$(this).hide();
	$(".fixedner").hide();
	$(".blow").hide();
});

// if(window.performance.navigation.type != 1){
// 	window.addEventListener('beforeunload',function(event){
// 		let e = event || window.event;
// 		e.preventDefault();
// 		if( e ){
// 			e.returnValue = '';
//
// 			return false;
// 		}
// 	})
// }